Close application command
A Close command is a request to close one or more objects.SYNTAX
close referenceToObject [ saving in referenceToFile ] [ saving saveOption ]PARAMETERS
- referenceToObject
- A reference to the object or objects to close.
Class: Reference- referenceToFile
- A reference of the form
file
nameString oralias
nameString (see "Notes").
Class: Reference
Default value: The file in which the object was last saved. If the object hasn't been saved before, the application creates a file with the specified name in the current directory.- saveOption
- A parameter that specifies whether to save an object that has been modified before closing it. The constant
yes
specifies that the object must be saved. The constantno
specifies that the object must not be saved. The constantask
specifies that the user must be asked whether or not to save the object.
Class: Constant
Default value: The default value isask
, unless you specify a
file in which to save the object, in which case the default value
isyes
.RESULT
NoneEXAMPLES
tell application "Scriptable Text Editor" close window "Tremendous" saving Yes end tell tell application "Scriptable Text Editor" close saving in file "Macintosh HD:Documents:Report"end tellNOTES
To specify the name (nameString) of a file in which to save the object, use a string of the form"Disk:Folder1:Folder2:...:Filename"
; for details, see "References to Files," which begins on page 144. You can also specify a string with only a filename ("Filename"). In this case, the application attempts to find the file in the current directory. If it can't find the specified file, the application creates a file with the specified name in the current directory.